<template>
	<div>
		<el-tabs v-model="activeName" @tab-click="handleClick">
			<el-tab-pane label="堂食" name="first">
				<TangShi ref="TangShiRef"></TangShi>
			</el-tab-pane>
			<el-tab-pane label="快餐" name="second">
				<KuaiCan ref="KuaiCanRef"></KuaiCan>
			</el-tab-pane>
			<el-tab-pane label="外卖" name="third">
				<WaiMai ref="WaiMaiRef"></WaiMai>
			</el-tab-pane>
		</el-tabs>
	</div>
</template>

<script>
import TangShi from './TangShi/TangShiQingDan.vue'
import KuaiCan from './KuaiCan/KuaiCanQingDan.vue'
import WaiMai from './WaiMai/WaiMaiQingDan.vue'
export default {
	components:{ 
		TangShi,
		KuaiCan,
		WaiMai
	},
	
	data() {
		return {
			activeName: 'first'
		};
	},

	created() {},

	methods: {
		handleClick(tab, event){
			if(tab.name === 'first'){
				this.$refs.TangShiRef.getDataList()
			}
			if(tab.name === 'second'){
				this.$refs.KuaiCanRef.getDataList()
			}
			if(tab.name === 'third'){
				this.$refs.WaiMaiRef.getDataList()
			}
		}
	}
};
</script>

<style></style>
